Skip to content

Conversation

@ArgoZhang
Copy link
Member

@ArgoZhang ArgoZhang commented Nov 1, 2025

Link issues

fixes #7043

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Add a new parameter to control whether row extension buttons are displayed as a grouped button group or as separate buttons

New Features:

  • Introduce IsGroupExtendButtons parameter on the Table component to toggle grouped or separated row extension buttons
  • Add CSS for .btn-separate to apply spacing between individual buttons when not grouped
  • Extend unit tests to verify both grouped and separate button layouts based on the new parameter

Copilot AI review requested due to automatic review settings November 1, 2025 03:13
@bb-auto bb-auto bot added the enhancement New feature or request label Nov 1, 2025
@bb-auto bb-auto bot added this to the 10.0.0 milestone Nov 1, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 1, 2025

Reviewer's Guide

Adds an IsGroupExtendButtons parameter to let consumers toggle between grouped or separated row extension buttons by introducing a new boolean parameter, generating dynamic CSS classes, updating the table rendering logic, extending styles, and adding unit tests.

Entity relationship diagram for Table component parameters

erDiagram
Table {
  int DefaultFixedColumnWidth
  bool IsGroupExtendButtons
}
ITable ||--o| Table : implements
IModelEqualityComparer ||--o| Table : implements
Loading

Class diagram for updated Table component with IsGroupExtendButtons parameter

classDiagram
class Table_TItem {
  +int DefaultFixedColumnWidth
  +bool IsGroupExtendButtons
  -string? ExtendButtonGroupClassString
  +GetSortTooltip(col)
}
Table_TItem --|> ITable
Table_TItem --|> IModelEqualityComparer_TItem
Loading

File-Level Changes

Change Details Files
Introduce IsGroupExtendButtons parameter and CSS class builder
  • Add IsGroupExtendButtons parameter with default value true
  • Implement ExtendButtonGroupClassString property to compute button container classes
Table.razor.cs
Refactor render fragments to use dynamic button group class
  • Replace hardcoded btn-group wrapper with ExtendButtonGroupClassString in RenderExtendButtons
  • Replace hardcoded btn-group wrapper with ExtendButtonGroupClassString in RenderRowExtendButtons
  • Change span wrapper to div for consistent structure
Table.razor
Add SCSS rule for separated button spacing
  • Define .btn-separate > button:not(:last-child) margin styling
Table.razor.scss
Extend unit tests to verify both grouping modes
  • Assert default render contains .btn-group
  • Set IsGroupExtendButtons to false and assert .btn-separate rendering
TableTest.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#7043 Add an IsGroupExtendButtons parameter to the Table component.
#7043 Update the Table component's rendering logic to use IsGroupExtendButtons to control whether row extension buttons are grouped or separated.
#7043 Add tests to verify the behavior of IsGroupExtendButtons in the Table component.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ArgoZhang ArgoZhang merged commit 2f53676 into main Nov 1, 2025
8 of 9 checks passed
@ArgoZhang ArgoZhang deleted the feat-group branch November 1, 2025 03:13
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • Consider using an inline container (e.g. a or a flex utility) instead of a
    for the button group to avoid unexpected block‐level layout shifts.
  • Make sure the new .btn-separate margin-inline-end spacing works in both LTR and RTL contexts—using logical properties for both sides may be more robust.
  • The parameter name IsGroupExtendButtons is a bit verbose and could be renamed (e.g. UseGroupedExtendButtons or GroupExpandButtons) for clearer intent and consistency.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider using an inline container (e.g. a <span> or a flex utility) instead of a <div> for the button group to avoid unexpected block‐level layout shifts.
- Make sure the new .btn-separate margin-inline-end spacing works in both LTR and RTL contexts—using logical properties for both sides may be more robust.
- The parameter name IsGroupExtendButtons is a bit verbose and could be renamed (e.g. UseGroupedExtendButtons or GroupExpandButtons) for clearer intent and consistency.

## Individual Comments

### Comment 1
<location> `test/UnitTest/Components/TableTest.cs:2030-2033` </location>
<code_context>
             });
         });
+
+        cut.Contains("<div class=\"btn-group\">");
+
+        var table = cut.FindComponent<Table<Foo>>();
</code_context>

<issue_to_address>
**suggestion (testing):** Missing assertion for the result of 'cut.Contains'.

Add an assertion for 'cut.Contains' to verify the expected HTML is present and ensure test failures are detected.

```suggestion
        Assert.True(cut.Contains("<div class=\"btn-group\">"), "Expected btn-group div to be present in the rendered output.");

        var table = cut.FindComponent<Table<Foo>>();
        Assert.NotNull(table);
```
</issue_to_address>

### Comment 2
<location> `test/UnitTest/Components/TableTest.cs:2039` </location>
<code_context>
+        {
+            pb.Add(a => a.IsGroupExtendButtons, false);
+        });
+        cut.Contains("<div class=\"btn-separate\">");
     }

</code_context>

<issue_to_address>
**suggestion (testing):** Missing assertion for the result of 'cut.Contains' after changing IsGroupExtendButtons.

Add an assertion to check that the rendered HTML matches expectations when IsGroupExtendButtons is false.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d4e13e8) to head (5fb707d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7044   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          743       743           
  Lines        32475     32480    +5     
  Branches      4500      4500           
=========================================
+ Hits         32475     32480    +5     
Flag Coverage Δ
BB 100.00% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new parameter IsGroupExtendButtons to the Table component to allow controlling whether row extend buttons are displayed as a button group or as separate buttons with spacing. By default, buttons remain grouped (maintaining backward compatibility).

Key changes:

  • Added IsGroupExtendButtons parameter with a default value of true to maintain existing behavior
  • Introduced ExtendButtonGroupClassString property that conditionally applies btn-group or btn-separate CSS classes
  • Added CSS styling for .btn-separate to apply spacing between buttons

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/BootstrapBlazor/Components/Table/Table.razor.cs Adds IsGroupExtendButtons parameter and ExtendButtonGroupClassString computed property
src/BootstrapBlazor/Components/Table/Table.razor Updates button container elements to use dynamic CSS class from ExtendButtonGroupClassString
src/BootstrapBlazor/Components/Table/Table.razor.scss Adds styling for .btn-separate class with margin spacing
test/UnitTest/Components/TableTest.cs Adds test assertions to verify both button group and separate button rendering
Comments suppressed due to low confidence (62)

test/UnitTest/Components/TableTest.cs:5346

  • The contents of this container are never accessed.
        var selectedRows = new List<Foo>();

src/BootstrapBlazor/Components/Table/Table.razor.cs:1175

  • Poor error handling: empty catch block.
                catch { }

src/BootstrapBlazor/Components/Table/Table.razor.cs:1343

  • Poor error handling: empty catch block.
        catch (TaskCanceledException) { }

test/UnitTest/Components/TableTest.cs:5107

  • Variable col may be null at this access because of this assignment.
        Assert.NotNull(col.Template);

test/UnitTest/Components/TableTest.cs:5147

  • Variable col may be null at this access because of this assignment.
        Assert.NotNull(col.EditTemplate);

test/UnitTest/Components/TableTest.cs:5172

  • Variable col may be null at this access because of this assignment.
        Assert.NotNull(col.SearchTemplate);

test/UnitTest/Components/TableTest.cs:328

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.ShowSkeleton, true);
                pb.Add(a => a.Items, Foo.GenerateFoo(localizer));
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:349

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.ShowLoadingInFirstRender, false);
                pb.Add(a => a.Items, Foo.GenerateFoo(localizer));
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:451

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:452

  • This assignment to searchModel is useless, since its value is never read.
        var searchModel = new FooSearchModel();

test/UnitTest/Components/TableTest.cs:1096

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:1147

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:1298

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.RenderMode, TableRenderMode.Table);
                pb.Add(a => a.IsPagination, true);
                pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer));
                pb.Add(a => a.PageItems, 2);
                pb.Add(a => a.ShowGotoNavigator, true);
                pb.Add(a => a.GotoTemplate, builder =>
                {
                    templated = true;
                });
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:1324

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.RenderMode, TableRenderMode.Table);
                pb.Add(a => a.IsPagination, true);
                pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer));
                pb.Add(a => a.PageItems, 2);
                pb.Add(a => a.ShowGotoNavigator, true);
                pb.Add(a => a.GotoNavigatorLabelText, "Test_GotoNavigatorLabelText");
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:1355

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:1814

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.RenderMode, TableRenderMode.Table);
                pb.Add(a => a.Items, Foo.GenerateFoo(localizer, 1));
                pb.Add(a => a.ColumnMinWidth, 100);
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", foo.Name);
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.AddAttribute(3, nameof(TableColumn<Foo, string>.Fixed), true);
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:1895

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.RenderMode, TableRenderMode.Table);
                pb.Add(a => a.Items, Foo.GenerateFoo(localizer, 2));
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", foo.Name);
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();

                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", foo.Name);
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();

                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", foo.Name);
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();

                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", foo.Address);
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Address", typeof(string)));
                    builder.AddAttribute(3, nameof(TableColumn<Foo, string>.Fixed), true);
                    builder.CloseComponent();

                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", foo.Address);
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Address", typeof(string)));
                    builder.AddAttribute(3, nameof(TableColumn<Foo, string>.Fixed), true);
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:2766

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:3227

  • This assignment to name is useless, since its value is never read.
        name = name = cut.Find("td").TextContent;

test/UnitTest/Components/TableTest.cs:3259

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.RenderMode, TableRenderMode.Table);
                pb.Add(a => a.ShowFilterHeader, true);
                pb.Add(a => a.IsDetails, true);
                pb.Add(a => a.DetailRowTemplate, foo => builder => builder.AddContent(0, foo.Name));
                pb.Add(a => a.IsMultipleSelect, true);
                pb.Add(a => a.ShowLineNo, true);
                pb.Add(a => a.ShowExtendButtons, true);
                pb.Add(a => a.IsExtendButtonsInRowHeader, true);
                pb.Add(a => a.ShowCheckboxText, showCheckboxText);
                pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer));
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:3285

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.RenderMode, TableRenderMode.Table);
                pb.Add(a => a.IsFixedHeader, fixedHeader);
                pb.Add(a => a.ShowFilterHeader, true);
                pb.Add(a => a.ShowExtendButtons, true);
                pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer));
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:4495

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<TableExtensionButton>(pb =>
            {
                pb.Add(a => a.ChildContent, builder =>
                {
                    builder.OpenComponent<MockButton>(0);
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:4759

  • This assignment to column is useless, since its value is never read.
        var column = cut.FindComponent<TableColumn<Foo, string>>();

test/UnitTest/Components/TableTest.cs:5338

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<FooNoKeyTree>>(pb =>
            {
                pb.Add(a => a.RenderMode, TableRenderMode.Table);
                pb.Add(a => a.OnQueryAsync, options =>
                {
                    var data = new QueryData<FooNoKeyTree>()
                    {
                        Items = items,
                        TotalCount = 80
                    };
                    return Task.FromResult(data);
                });
                pb.Add(a => a.SelectedRows, selectedRows);
                pb.Add(a => a.IsMultipleSelect, true);
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:5346

  • This assignment to selectedRows is useless, since its value is never read.
        var selectedRows = new List<Foo>();

test/UnitTest/Components/TableTest.cs:6225

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.RenderMode, TableRenderMode.Table);
                pb.Add(a => a.OnQueryAsync, op =>
                {
                    sortList.AddRange(op.SortList!);
                    return OnQueryAsync(localizer, isSorted: false)(op);
                });
                pb.Add(a => a.SortString, "Name Desc, Count");
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();

                    builder.OpenComponent<TableColumn<Foo, int>>(0);
                    builder.AddAttribute(1, "Field", 1);
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Count", typeof(int)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:6236

  • This assignment to items is useless, since its value is never read.
        var items = Foo.GenerateFoo(localizer, 2);

test/UnitTest/Components/TableTest.cs:6263

  • This assignment to items is useless, since its value is never read.
        var items = Foo.GenerateFoo(localizer, 2);

test/UnitTest/Components/TableTest.cs:6301

  • This assignment to items is useless, since its value is never read.
        var items = Foo.GenerateFoo(localizer, 2);

test/UnitTest/Components/TableTest.cs:6330

  • This assignment to items is useless, since its value is never read.
        var items = Foo.GenerateFoo(localizer, 2);

test/UnitTest/Components/TableTest.cs:6354

  • This assignment to items is useless, since its value is never read.
        var items = Foo.GenerateFoo(localizer, 2);

test/UnitTest/Components/TableTest.cs:6390

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.RenderMode, TableRenderMode.Table);
                pb.Add(a => a.OnQueryAsync, op =>
                {
                    op.CustomerSearches.AddRange(new List<IFilterAction>() { new MockFilterAction() });
                    op.Filters.AddRange(new List<IFilterAction>() { new MockFilterAction() });
                    return OnQueryAsync(localizer, isAdvanceSearch: false, isFilter: false)(op);
                });
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:7113

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:7231

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.RenderMode, TableRenderMode.Table);
                pb.Add(a => a.Items, items);
                pb.Add(a => a.IsExcel, true);
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:7347

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.RenderMode, TableRenderMode.Table);
                pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer));
                pb.Add(a => a.OnAfterRenderCallback, (table, firstRender) =>
                {
                    callback = true;
                    return Task.CompletedTask;
                });
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:7416

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:7440

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:7510

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.RenderMode, TableRenderMode.Table);
                pb.Add(a => a.OnQueryAsync, async op =>
                {
                    index++;
                    var data = await OnQueryAsync(localizer)(op);
                    return data;
                });
                pb.Add(a => a.IsAutoRefresh, true);
                pb.Add(a => a.AutoRefreshInterval, 600);
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:7544

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:7574

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:7598

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:7644

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.RenderMode, TableRenderMode.Table);
                pb.Add(a => a.Items, items);
                pb.Add(a => a.OnColumnCreating, cols =>
                {
                    creating = true;
                    return Task.CompletedTask;
                });
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:7651

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:7690

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:7729

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:7919

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:7957

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:7982

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:7996

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<MockTable>(pb =>
            {
                pb.Add(a => a.Items, new List<Foo> { new() });
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, DateTime?>>(0);
                    builder.AddAttribute(1, "Field", DateTime.Now);
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "DateTime", typeof(DateTime?)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:8003

  • This assignment to localizer is useless, since its value is never read.
        var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();

test/UnitTest/Components/TableTest.cs:8300

  • This assignment to items is useless, since its value is never read.
        var items = Foo.GenerateFoo(localizer, 2);

test/UnitTest/Components/TableTest.cs:8581

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer));
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<Foo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:8687

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
        {
            pb.AddChildContent<Table<MockFoo>>(pb =>
            {
                pb.Add(a => a.CreateItemCallback, () => new MockFoo(""));
                pb.Add(a => a.OnQueryAsync, op =>
                {
                    var items = new List<MockFoo>()
                    {
                        new("Test-1")
                    };
                    var data = new QueryData<MockFoo>()
                    {
                        Items = items,
                        TotalCount = items.Count,
                    };
                    return Task.FromResult(data);
                });
                pb.Add(a => a.TableColumns, foo => builder =>
                {
                    builder.OpenComponent<TableColumn<MockFoo, string>>(0);
                    builder.AddAttribute(1, "Field", "Name");
                    builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                    builder.CloseComponent();
                });
            });
        });

test/UnitTest/Components/TableTest.cs:8792

  • This assignment to cut is useless, since its value is never read.
        var cut = Context.RenderComponent<Table<Foo>>(pb =>
        {
            pb.AddCascadingValue<ISortableList>(new SortableList());
            pb.Add(a => a.TableColumns, foo => builder =>
            {
                builder.OpenComponent<TableColumn<Foo, string>>(0);
                builder.AddAttribute(1, "Field", "Name");
                builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
                builder.CloseComponent();
            });
            pb.Add(a => a.RenderMode, TableRenderMode.Table);
            pb.Add(a => a.Items, Foo.GenerateFoo(localizer));
        });

test/UnitTest/Components/TableTest.cs:44

  • This assignment to cut is useless, since its value is never read.
            var cut = Context.RenderComponent<Table<Foo>>(pb =>
            {
                pb.Add(a => a.Items, Foo.GenerateFoo(localizer));
                pb.Add(a => a.OnQueryAsync, option => Task.FromResult<QueryData<Foo>>(null!));
            });

test/UnitTest/Components/TableTest.cs:8852

  • This assignment to propertyName is useless, since its value is never read.
            var propertyName = col.GetFieldName();

test/UnitTest/Components/TableTest.cs:635

  • This assignment to index is useless, since its value is never read.
                    builder.AddAttribute(index++, nameof(TableColumn<Foo, string>.Filterable), true);

test/UnitTest/Components/TableTest.cs:677

  • This assignment to index is useless, since its value is never read.
                    builder.AddAttribute(index++, nameof(TableColumn<Foo, string>.FilterTemplate), new RenderFragment(pb =>

test/UnitTest/Components/TableTest.cs:718

  • This assignment to index is useless, since its value is never read.
                    builder.AddAttribute(index++, nameof(TableColumn<Foo, string>.Filterable), true);

src/BootstrapBlazor/Components/Table/Table.razor:810

  • This assignment to col is useless, since its value is never read.
        @foreach (var col in GetVisibleColumns())

test/UnitTest/Components/TableTest.cs:3345

  • The expression 'A == false' can be simplified to '!A'.
        if (isDetails.HasValue && isDetails.Value == false)

src/BootstrapBlazor/Components/Table/Table.razor.cs:1175

  • Generic catch clause.
                catch { }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(Table): add IsGroupExtendButtons parameter

2 participants